// FILEPATH: src/api/scanner.js

import axios from 'axios';

const API_BASE_URL = 'http://your-api-server-url';

export const startScan = async (target) => {
  try {
    const response = await axios.post(`${API_BASE_URL}/scan/start`, { target });
    return response.data;
  } catch (error) {
    console.error('Failed to start scan:', error);
    throw error;
  }
};

export const stopScan = async () => {
  try {
    const response = await axios.post(`${API_BASE_URL}/scan/stop`);
    return response.data;
  } catch (error) {
    console.error('Failed to stop scan:', error);
    throw error;
  }
};
